
#include "MyD3D.h"
#include "Exception.h"
#include "Macro.h"

namespace D3Ds
{
	D3D::D3D()
	{
		m_pD3D=NULL;
		m_pD3D=Direct3DCreate9(D3D_SDK_VERSION);
		if(!m_pD3D)
		{
			throw(FailToInitD3D());
		}
	}

	LPDIRECT3D9 D3D::GetD3D()
	{
		return m_pD3D;
	}

	D3D::~D3D(void)
	{
		SAFE_DELETE(m_pD3D);
	}

	RTG_VECTOR3::RTG_VECTOR3()
	{
		x=0.0f;
		y=0.0f;
		z=0.0f;
	}
	RTG_VECTOR3::RTG_VECTOR3(float& _x,float& _y,float& _z)
	{
		x=_x;
		y=_y;
		z=_z;
	}
	RTG_VECTOR2::RTG_VECTOR2()
	{
		x=0.0f;
		y=0.0f;
	}
	RTG_VECTOR2::RTG_VECTOR2(float& _x,float& _y)
	{
		x=_x;
		y=_y;
	}
	RTG_VERTEX::RTG_VERTEX()
	{
		x = 0.0f;
		y = 0.0f;
		z = 0.0f;
		tx = 0.0f;
		ty = 0.0f;
		diffuse = 0xffffffff;
	}
}